// @ts-check

import { default as deploymentApiSidebar } from "./docs/deployment-api/sidebar";
//import { default as publicHttpApiSidebar } from "./docs/public-deployment-api/sidebar";
import { default as managementApiSidebar } from "./docs/management-api/sidebar";

/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebars = {
  docs: [
    {
      type: "doc",
      // If you change this make sure to update
      // src/theme/DocSidebar/Desktop/index.js
      // home link
      id: "home",
      label: "Home",
      className: "convex-sidebar-home",
    },
    {
      type: "link",
      href: "https://dashboard.convex.dev",
      label: "Dashboard",
      className:
        "convex-sidebar-dashboard convex-sidebar-mobile-only convex-sidebar-external-link",
    },
    {
      type: "link",
      href: "https://stack.convex.dev/",
      label: "Blog",
      className:
        "convex-sidebar-stack convex-sidebar-mobile-only convex-sidebar-external-link",
    },
    {
      type: "link",
      href: "https://github.com/get-convex",
      label: "GitHub",
      className:
        "convex-sidebar-github convex-sidebar-mobile-only convex-sidebar-external-link",
    },
    {
      type: "link",
      href: "https://convex.dev/community",
      label: "Discord",
      className:
        "convex-sidebar-discord convex-sidebar-mobile-only convex-sidebar-external-link",
    },
    {
      type: "html",
      value: '<hr class="convex-menu-divider" />',
      defaultStyle: false,
    },
    {
      type: "html",
      value: '<div class="convex-menu-header">Get Started</div>',
      defaultStyle: false,
    },
    {
      type: "category",
      label: "Tutorial",
      link: { type: "doc", id: "tutorial/index" },
      items: [{ type: "autogenerated", dirName: "tutorial" }],
      className: "convex-sidebar-tutorial convex-sidebar-no-category-page",
    },
    {
      type: "category",
      label: "Quickstarts",
      link: { type: "doc", id: "quickstarts" },
      items: [{ type: "autogenerated", dirName: "quickstart" }],
      className: "convex-sidebar-quickstart",
    },
    {
      type: "category",
      label: "Understand Convex",
      link: { type: "doc", id: "understanding/index" },
      items: [{ type: "autogenerated", dirName: "understanding" }],
      className: "convex-sidebar-understand convex-sidebar-no-category-page",
    },
    {
      type: "html",
      value: '<hr class="convex-menu-divider" />',
      defaultStyle: false,
    },
    {
      type: "html",
      value: '<div class="convex-menu-header">Platform</div>',
      defaultStyle: false,
    },
    {
      type: "category",
      label: "Functions",
      link: { type: "doc", id: "functions" },
      items: [{ type: "autogenerated", dirName: "functions" }],
      className: "convex-sidebar-functions",
    },
    {
      type: "category",
      label: "Database",
      link: { type: "doc", id: "database" },
      items: [{ type: "autogenerated", dirName: "database" }],
      className: "convex-sidebar-database",
    },
    {
      type: "doc",
      id: "realtime",
      className: "convex-sidebar-realtime",
    },
    {
      type: "category",
      label: "Authentication",
      link: { type: "doc", id: "auth" },
      items: [{ type: "autogenerated", dirName: "auth" }],
      className: "convex-sidebar-auth",
    },
    {
      type: "category",
      label: "Scheduling",
      link: { type: "doc", id: "scheduling" },
      items: [{ type: "autogenerated", dirName: "scheduling" }],
      className: "convex-sidebar-scheduling",
    },
    {
      type: "category",
      label: "File Storage",
      link: { type: "doc", id: "file-storage" },
      items: [{ type: "autogenerated", dirName: "file-storage" }],
      className: "convex-sidebar-file-storage",
    },
    {
      type: "category",
      label: "Search",
      link: { type: "doc", id: "search" },
      items: [{ type: "autogenerated", dirName: "search" }],
      className: "convex-sidebar-search",
    },
    {
      type: "category",
      label: "Components",
      link: { type: "doc", id: "components" },
      items: [{ type: "autogenerated", dirName: "components" }],
      className: "convex-sidebar-components",
    },

    {
      type: "html",
      value: '<hr class="convex-menu-divider" />',
      defaultStyle: false,
    },
    {
      type: "html",
      value: '<div class="convex-menu-header">Guides</div>',
      defaultStyle: false,
    },
    {
      type: "category",
      label: "AI Code Gen",
      link: { type: "doc", id: "ai" },
      items: [{ type: "autogenerated", dirName: "ai" }],
      className: "convex-sidebar-ai",
    },
    {
      type: "category",
      label: "Agents",
      link: { type: "doc", id: "agents" },
      items: [{ type: "autogenerated", dirName: "agents" }],
      className: "convex-sidebar-ai-agents",
    },
    {
      type: "doc",
      id: "chef",
      className: "convex-sidebar-chef",
    },
    {
      type: "category",
      label: "Testing",
      link: { type: "doc", id: "testing" },
      items: [{ type: "autogenerated", dirName: "testing" }],
      className: "convex-sidebar-testing",
    },
    {
      type: "category",
      label: "Production",
      link: { type: "doc", id: "production" },
      items: [{ type: "autogenerated", dirName: "production" }],
      className: "convex-sidebar-production",
    },
    {
      type: "doc",
      id: "self-hosting",
      className: "convex-sidebar-self-hosting",
    },
    {
      type: "category",
      label: "Platform APIs",
      link: { type: "doc", id: "platform-apis" },
      items: [{ type: "autogenerated", dirName: "platform-apis" }],
      className: "convex-sidebar-platform-apis",
    },
    {
      type: "html",
      value: '<hr class="convex-menu-divider" />',
      defaultStyle: false,
    },
    {
      type: "html",
      value: '<div class="convex-menu-header">Client Libraries</div>',
      defaultStyle: false,
    },
    {
      type: "category",
      label: "React",
      link: { type: "doc", id: "client/react" },
      items: [{ type: "autogenerated", dirName: "client/react" }],
      className: "convex-sidebar-react",
    },
    {
      type: "category",
      label: "Next.js",
      link: { type: "doc", id: "client/nextjs/app-router/index" },
      items: [{ type: "autogenerated", dirName: "client/nextjs" }],
      className: "convex-sidebar-nextjs convex-sidebar-no-category-page",
    },
    {
      type: "category",
      label: "TanStack",
      link: { type: "doc", id: "client/tanstack/tanstack-query/index" },
      items: [{ type: "autogenerated", dirName: "client/tanstack" }],
      className: "convex-sidebar-tanstack convex-sidebar-no-category-page",
    },
    {
      type: "doc",
      id: "client/react-native",
      label: "React Native",
      className: "convex-sidebar-react-native",
    },
    {
      type: "category",
      label: "JavaScript",
      link: { type: "doc", id: "client/javascript" },
      items: [{ type: "autogenerated", dirName: "client/javascript" }],
      className: "convex-sidebar-javascript",
    },
    {
      type: "category",
      label: "Vue",
      link: { type: "doc", id: "client/vue" },
      items: [{ type: "autogenerated", dirName: "client/vue" }],
      className: "convex-sidebar-vue",
    },
    {
      type: "doc",
      id: "client/svelte",
      label: "Svelte",
      className: "convex-sidebar-svelte",
    },
    {
      type: "doc",
      id: "client/python",
      label: "Python",
      className: "convex-sidebar-python",
    },
    {
      type: "category",
      label: "Swift",
      link: { type: "doc", id: "client/swift" },
      items: [{ type: "autogenerated", dirName: "client/swift" }],
      className: "convex-sidebar-swift",
    },
    {
      type: "category",
      label: "Android Kotlin",
      link: { type: "doc", id: "client/android" },
      items: [{ type: "autogenerated", dirName: "client/android" }],
      className: "convex-sidebar-android",
    },
    {
      type: "doc",
      id: "client/rust",
      label: "Rust",
      className: "convex-sidebar-rust",
    },
    {
      type: "doc",
      id: "client/open-api",
      label: "Open API",
      className: "convex-sidebar-open-api",
    },
    {
      type: "html",
      value: '<hr class="convex-menu-divider" />',
      defaultStyle: false,
    },
    {
      type: "html",
      value: '<div class="convex-menu-header">Tools</div>',
      defaultStyle: false,
    },
    {
      type: "category",
      label: "Dashboard",
      className: "convex-sidebar-dashboard",
      items: [{ type: "autogenerated", dirName: "dashboard" }],
      link: { type: "doc", id: "dashboard" },
    },
    {
      type: "category",
      label: "CLI",
      className: "convex-sidebar-cli",
      items: [{ type: "autogenerated", dirName: "cli" }],
      link: { type: "doc", id: "cli" },
    },
    {
      type: "html",
      value: '<hr class="convex-menu-divider" />',
      defaultStyle: false,
    },
    {
      type: "html",
      value: '<div class="convex-menu-header">API Reference</div>',
      defaultStyle: false,
    },
    {
      type: "category",
      label: "Convex API",
      collapsible: true,
      link: { type: "doc", id: "api/index" },
      items: [{ type: "autogenerated", dirName: "api" }],
      className: "convex-sidebar-convex-api",
    },
    {
      type: "category",
      label: "Generated Code",
      collapsible: true,
      link: { type: "doc", id: "generated-api/index" },
      items: [{ type: "autogenerated", dirName: "generated-api" }],
      className: "convex-sidebar-generated-code",
    },
    /*
    {
      type: "category",
      label: "HTTP API",
      link: { type: "doc", id: "http-api/index" },
      // the UNTAGGED section
      items: publicHttpApiSidebar[1].items,
      className: "convex-sidebar-http-api",
    },
    */
    {
      type: "category",
      label: "Deployment API",
      link: { type: "doc", id: "deployment-api" },
      items: [
        {
          type: "doc",
          id: "http-api/index",
          label: "HTTP API",
          className: "convex-sidebar-http-api",
        },
        {
          type: "doc",
          id: "streaming-export-api",
          label: "Streaming Export",
        },
        {
          type: "doc",
          id: "streaming-import-api",
          label: "Streaming Import",
        },
        {
          type: "category",
          label: "Platform",
          link: { type: "doc", id: "deployment-platform-api" },
          // the UNTAGGED section
          items: deploymentApiSidebar[1].items,
        },
      ],
      className: "convex-sidebar-http-api",
    },
    {
      type: "category",
      label: "Management API",
      link: { type: "doc", id: "management-api" },
      // the UNTAGGED section
      items: managementApiSidebar[1].items,
      className: "convex-sidebar-http-api",
    },
    {
      type: "doc",
      id: "error",
      label: "Errors",
      className: "convex-sidebar-http-api",
    },
    {
      type: "doc",
      id: "eslint",
      label: "ESLint",
      className: "convex-sidebar-eslint",
    },
  ],
};

module.exports = sidebars;
